package com.bbs.model;

import java.util.List;

/**
 * 分页
 * @author caikc
 * @param <E>
 *
 */
public class Pagination<E> {
	
	private int pageIndex;
	private int pageSize;
	private int pageTotal;
	List<E> items;
	/**
	 * @return the pageIndex
	 */
	public int getPageIndex() {
		return pageIndex;
	}
	/**
	 * @param pageIndex the pageIndex to set
	 */
	public void setPageIndex(int pageIndex) {
		this.pageIndex = pageIndex;
	}
	/**
	 * @return the pageSize
	 */
	public int getPageSize() {
		return pageSize;
	}
	/**
	 * @param pageSize the pageSize to set
	 */
	public void setPageSize(int pageSize) {
		this.pageSize = pageSize;
	}
	/**
	 * @return the pageTotal
	 */
	public int getPageTotal() {
		return pageTotal;
	}
	/**
	 * @param pageTotal the pageTotal to set
	 */
	public void setPageTotal(int pageTotal) {
		this.pageTotal = pageTotal;
	}
	/**
	 * @return the items
	 */
	public List<E> getItems() {
		return items;
	}
	/**
	 * @param items the items to set
	 */
	public void setItems(List<E> items) {
		this.items = items;
	}
	/* (non-Javadoc)
	 * @see java.lang.Object#hashCode()
	 */
	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((items == null) ? 0 : items.hashCode());
		result = prime * result + pageIndex;
		result = prime * result + pageSize;
		result = prime * result + pageTotal;
		return result;
	}
	/* (non-Javadoc)
	 * @see java.lang.Object#equals(java.lang.Object)
	 */
	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		Pagination other = (Pagination) obj;
		if (items == null) {
			if (other.items != null)
				return false;
		} else if (!items.equals(other.items))
			return false;
		if (pageIndex != other.pageIndex)
			return false;
		if (pageSize != other.pageSize)
			return false;
		if (pageTotal != other.pageTotal)
			return false;
		return true;
	}
	
	

}
